﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AdminMenuManager.ascx.cs" Inherits="CMS.Controls.AdminMenu.AdminMenuManager" %>
<%@ Import Namespace="Core.Library" %>

<div class="stats">
    <ul>
        <li><a title="" class="count green" href="#"><%= TotalMenu %></a><span>Menus</span></li>                        
        <li><a title="" class="count orange" href="#"><%= TotalIsVisibled %></a><span>Is Visibled</span></li>                        
        <li><a title="" class="count red" href="#"><%= TotalIsVisibleWhenRun %></a><span>Is Visibled When Run</span></li>                        
    </ul>
    <div class="fix"></div>
</div>
<!-- / statistics -->

<asp:Literal ID="ltMessage" runat="server" />
<!-- / message -->

<asp:PlaceHolder ID="plcControl" runat="server"/>
<!-- / placeholder -->

<div class="widget first">
    <div class="head"><h5 class="iFrames">Danh sách chức năng</h5></div>
    <div class="dataTables_wrapper">
        <div class="dataTables_filter" style="top: -39px;">
            <label>
                <a href="<%= UrlHelpers.CreateMenu %>" class="btn14 topDir" title="Tạo chức năng mới">
                    <img src="/images/icons/dark/add.png" alt=""/>
                </a>
            </label>
        </div>
    </div>

    <asp:ListView ID="lvMenu" DataKeyNames="AdminMenuId" OnItemCommand="lvMenu_ItemCommand" runat="server">
    <LayoutTemplate>    
        <table width="100%" cellspacing="0" cellpadding="0" class="tableStatic">
            <thead>
                <tr>
                    <td class="w45">STT</td>
                    <td>Tên chức năng</td>                
                    <td>Đường dẫn</td>
                    <td>Độ ưu tiên</td>       
                    <td>Tham số</td>              
                    <td class="w60">Trạng thái</td>              
                    <td class="w100">Thao tác</td>
                </tr>
            </thead>
            <tbody>
                <tr id="itemPlaceHolder" runat="server"></tr>
            </tbody>
        </table>

    </LayoutTemplate>
    <ItemTemplate>
        <tr>
            <td class="aligncenter"><%# Container.DataItemIndex + 1 %></td>
            <td><%# Eval("Name")%></td>
            <td><%# Eval("CtrlSource")%></td>
            <td class="aligncenter"><%# Eval("Priority")%></td>            
            <td class="aligncenter"><%# Eval("Params")%></td>
            <td class="aligncenter"><%# GetStatus(ConvertUtility.ConvertTo<int>(Eval("Status")))%></td>            
            <td class="aligncenter">
                <a href="<%# UrlHelpers.EditMenu(ConvertUtility.ConvertTo<int>(Eval("AdminMenuId"))) %>" title="Sửa" class="btn14 topDir">
                    <img src="/images/icons/dark/pencil.png" alt="Sửa"/>
                </a>
                <asp:LinkButton ID="lnkDelete" ToolTip="Xóa" CssClass="ml5 btn14 topDir" OnClientClick="return confirm('Bạn có chắc chắn muốn xóa?');" CommandName="DeleteMenu" runat="server">
                    <img src="/images/icons/dark/close.png" alt="Xóa"/>
                </asp:LinkButton>                                  
            </td>
        </tr>                	
    </ItemTemplate>
    </asp:ListView>    
</div>
<!-- / list menu -->
